/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.caresms.service.persistence;

import com.caresms.NoSuchKeyword_Sms_RelationException;

import com.caresms.model.Keyword_Sms_Relation;
import com.caresms.model.impl.Keyword_Sms_RelationImpl;
import com.caresms.model.impl.Keyword_Sms_RelationModelImpl;

import com.liferay.portal.NoSuchModelException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.BatchSessionUtil;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * The persistence implementation for the keyword_ sms_ relation service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author cc
 * @see Keyword_Sms_RelationPersistence
 * @see Keyword_Sms_RelationUtil
 * @generated
 */
public class Keyword_Sms_RelationPersistenceImpl extends BasePersistenceImpl<Keyword_Sms_Relation>
	implements Keyword_Sms_RelationPersistence {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. Always use {@link Keyword_Sms_RelationUtil} to access the keyword_ sms_ relation persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */
	public static final String FINDER_CLASS_NAME_ENTITY = Keyword_Sms_RelationImpl.class.getName();
	public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
		".List1";
	public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
		".List2";
	public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationModelImpl.FINDER_CACHE_ENABLED,
			Keyword_Sms_RelationImpl.class,
			FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
	public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationModelImpl.FINDER_CACHE_ENABLED,
			Keyword_Sms_RelationImpl.class,
			FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
	public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationModelImpl.FINDER_CACHE_ENABLED, Long.class,
			FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);

	/**
	 * Caches the keyword_ sms_ relation in the entity cache if it is enabled.
	 *
	 * @param keyword_Sms_Relation the keyword_ sms_ relation
	 */
	public void cacheResult(Keyword_Sms_Relation keyword_Sms_Relation) {
		EntityCacheUtil.putResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationImpl.class,
			keyword_Sms_Relation.getPrimaryKey(), keyword_Sms_Relation);

		keyword_Sms_Relation.resetOriginalValues();
	}

	/**
	 * Caches the keyword_ sms_ relations in the entity cache if it is enabled.
	 *
	 * @param keyword_Sms_Relations the keyword_ sms_ relations
	 */
	public void cacheResult(List<Keyword_Sms_Relation> keyword_Sms_Relations) {
		for (Keyword_Sms_Relation keyword_Sms_Relation : keyword_Sms_Relations) {
			if (EntityCacheUtil.getResult(
						Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
						Keyword_Sms_RelationImpl.class,
						keyword_Sms_Relation.getPrimaryKey()) == null) {
				cacheResult(keyword_Sms_Relation);
			}
			else {
				keyword_Sms_Relation.resetOriginalValues();
			}
		}
	}

	/**
	 * Clears the cache for all keyword_ sms_ relations.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	@Override
	public void clearCache() {
		if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
			CacheRegistryUtil.clear(Keyword_Sms_RelationImpl.class.getName());
		}

		EntityCacheUtil.clearCache(Keyword_Sms_RelationImpl.class.getName());

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	/**
	 * Clears the cache for the keyword_ sms_ relation.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	@Override
	public void clearCache(Keyword_Sms_Relation keyword_Sms_Relation) {
		EntityCacheUtil.removeResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationImpl.class, keyword_Sms_Relation.getPrimaryKey());

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	@Override
	public void clearCache(List<Keyword_Sms_Relation> keyword_Sms_Relations) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

		for (Keyword_Sms_Relation keyword_Sms_Relation : keyword_Sms_Relations) {
			EntityCacheUtil.removeResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
				Keyword_Sms_RelationImpl.class,
				keyword_Sms_Relation.getPrimaryKey());
		}
	}

	/**
	 * Creates a new keyword_ sms_ relation with the primary key. Does not add the keyword_ sms_ relation to the database.
	 *
	 * @param KeySmsId the primary key for the new keyword_ sms_ relation
	 * @return the new keyword_ sms_ relation
	 */
	public Keyword_Sms_Relation create(long KeySmsId) {
		Keyword_Sms_Relation keyword_Sms_Relation = new Keyword_Sms_RelationImpl();

		keyword_Sms_Relation.setNew(true);
		keyword_Sms_Relation.setPrimaryKey(KeySmsId);

		return keyword_Sms_Relation;
	}

	/**
	 * Removes the keyword_ sms_ relation with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param KeySmsId the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation that was removed
	 * @throws com.caresms.NoSuchKeyword_Sms_RelationException if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public Keyword_Sms_Relation remove(long KeySmsId)
		throws NoSuchKeyword_Sms_RelationException, SystemException {
		return remove(Long.valueOf(KeySmsId));
	}

	/**
	 * Removes the keyword_ sms_ relation with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param primaryKey the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation that was removed
	 * @throws com.caresms.NoSuchKeyword_Sms_RelationException if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public Keyword_Sms_Relation remove(Serializable primaryKey)
		throws NoSuchKeyword_Sms_RelationException, SystemException {
		Session session = null;

		try {
			session = openSession();

			Keyword_Sms_Relation keyword_Sms_Relation = (Keyword_Sms_Relation)session.get(Keyword_Sms_RelationImpl.class,
					primaryKey);

			if (keyword_Sms_Relation == null) {
				if (_log.isWarnEnabled()) {
					_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
				}

				throw new NoSuchKeyword_Sms_RelationException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
					primaryKey);
			}

			return remove(keyword_Sms_Relation);
		}
		catch (NoSuchKeyword_Sms_RelationException nsee) {
			throw nsee;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	@Override
	protected Keyword_Sms_Relation removeImpl(
		Keyword_Sms_Relation keyword_Sms_Relation) throws SystemException {
		keyword_Sms_Relation = toUnwrappedModel(keyword_Sms_Relation);

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.delete(session, keyword_Sms_Relation);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		clearCache(keyword_Sms_Relation);

		return keyword_Sms_Relation;
	}

	@Override
	public Keyword_Sms_Relation updateImpl(
		com.caresms.model.Keyword_Sms_Relation keyword_Sms_Relation,
		boolean merge) throws SystemException {
		keyword_Sms_Relation = toUnwrappedModel(keyword_Sms_Relation);

		boolean isNew = keyword_Sms_Relation.isNew();

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.update(session, keyword_Sms_Relation, merge);

			keyword_Sms_Relation.setNew(false);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

		if (isNew) {
			FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
		}

		EntityCacheUtil.putResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
			Keyword_Sms_RelationImpl.class,
			keyword_Sms_Relation.getPrimaryKey(), keyword_Sms_Relation);

		return keyword_Sms_Relation;
	}

	protected Keyword_Sms_Relation toUnwrappedModel(
		Keyword_Sms_Relation keyword_Sms_Relation) {
		if (keyword_Sms_Relation instanceof Keyword_Sms_RelationImpl) {
			return keyword_Sms_Relation;
		}

		Keyword_Sms_RelationImpl keyword_Sms_RelationImpl = new Keyword_Sms_RelationImpl();

		keyword_Sms_RelationImpl.setNew(keyword_Sms_Relation.isNew());
		keyword_Sms_RelationImpl.setPrimaryKey(keyword_Sms_Relation.getPrimaryKey());

		keyword_Sms_RelationImpl.setKeySmsId(keyword_Sms_Relation.getKeySmsId());
		keyword_Sms_RelationImpl.setSmsId(keyword_Sms_Relation.getSmsId());
		keyword_Sms_RelationImpl.setKeyId(keyword_Sms_Relation.getKeyId());
		keyword_Sms_RelationImpl.setCat_Id(keyword_Sms_Relation.getCat_Id());
		keyword_Sms_RelationImpl.setField1(keyword_Sms_Relation.getField1());
		keyword_Sms_RelationImpl.setField2(keyword_Sms_Relation.isField2());
		keyword_Sms_RelationImpl.setField3(keyword_Sms_Relation.getField3());
		keyword_Sms_RelationImpl.setField4(keyword_Sms_Relation.getField4());
		keyword_Sms_RelationImpl.setField5(keyword_Sms_Relation.getField5());

		return keyword_Sms_RelationImpl;
	}

	/**
	 * Returns the keyword_ sms_ relation with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
	 *
	 * @param primaryKey the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation
	 * @throws com.liferay.portal.NoSuchModelException if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public Keyword_Sms_Relation findByPrimaryKey(Serializable primaryKey)
		throws NoSuchModelException, SystemException {
		return findByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Returns the keyword_ sms_ relation with the primary key or throws a {@link com.caresms.NoSuchKeyword_Sms_RelationException} if it could not be found.
	 *
	 * @param KeySmsId the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation
	 * @throws com.caresms.NoSuchKeyword_Sms_RelationException if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public Keyword_Sms_Relation findByPrimaryKey(long KeySmsId)
		throws NoSuchKeyword_Sms_RelationException, SystemException {
		Keyword_Sms_Relation keyword_Sms_Relation = fetchByPrimaryKey(KeySmsId);

		if (keyword_Sms_Relation == null) {
			if (_log.isWarnEnabled()) {
				_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + KeySmsId);
			}

			throw new NoSuchKeyword_Sms_RelationException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				KeySmsId);
		}

		return keyword_Sms_Relation;
	}

	/**
	 * Returns the keyword_ sms_ relation with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param primaryKey the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation, or <code>null</code> if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public Keyword_Sms_Relation fetchByPrimaryKey(Serializable primaryKey)
		throws SystemException {
		return fetchByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Returns the keyword_ sms_ relation with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param KeySmsId the primary key of the keyword_ sms_ relation
	 * @return the keyword_ sms_ relation, or <code>null</code> if a keyword_ sms_ relation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public Keyword_Sms_Relation fetchByPrimaryKey(long KeySmsId)
		throws SystemException {
		Keyword_Sms_Relation keyword_Sms_Relation = (Keyword_Sms_Relation)EntityCacheUtil.getResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
				Keyword_Sms_RelationImpl.class, KeySmsId);

		if (keyword_Sms_Relation == _nullKeyword_Sms_Relation) {
			return null;
		}

		if (keyword_Sms_Relation == null) {
			Session session = null;

			boolean hasException = false;

			try {
				session = openSession();

				keyword_Sms_Relation = (Keyword_Sms_Relation)session.get(Keyword_Sms_RelationImpl.class,
						Long.valueOf(KeySmsId));
			}
			catch (Exception e) {
				hasException = true;

				throw processException(e);
			}
			finally {
				if (keyword_Sms_Relation != null) {
					cacheResult(keyword_Sms_Relation);
				}
				else if (!hasException) {
					EntityCacheUtil.putResult(Keyword_Sms_RelationModelImpl.ENTITY_CACHE_ENABLED,
						Keyword_Sms_RelationImpl.class, KeySmsId,
						_nullKeyword_Sms_Relation);
				}

				closeSession(session);
			}
		}

		return keyword_Sms_Relation;
	}

	/**
	 * Returns all the keyword_ sms_ relations.
	 *
	 * @return the keyword_ sms_ relations
	 * @throws SystemException if a system exception occurred
	 */
	public List<Keyword_Sms_Relation> findAll() throws SystemException {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}

	/**
	 * Returns a range of all the keyword_ sms_ relations.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of keyword_ sms_ relations
	 * @param end the upper bound of the range of keyword_ sms_ relations (not inclusive)
	 * @return the range of keyword_ sms_ relations
	 * @throws SystemException if a system exception occurred
	 */
	public List<Keyword_Sms_Relation> findAll(int start, int end)
		throws SystemException {
		return findAll(start, end, null);
	}

	/**
	 * Returns an ordered range of all the keyword_ sms_ relations.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of keyword_ sms_ relations
	 * @param end the upper bound of the range of keyword_ sms_ relations (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	 * @return the ordered range of keyword_ sms_ relations
	 * @throws SystemException if a system exception occurred
	 */
	public List<Keyword_Sms_Relation> findAll(int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		FinderPath finderPath = null;
		Object[] finderArgs = new Object[] { start, end, orderByComparator };

		if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
				(orderByComparator == null)) {
			finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
			finderArgs = FINDER_ARGS_EMPTY;
		}
		else {
			finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
			finderArgs = new Object[] { start, end, orderByComparator };
		}

		List<Keyword_Sms_Relation> list = (List<Keyword_Sms_Relation>)FinderCacheUtil.getResult(finderPath,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;
			String sql = null;

			if (orderByComparator != null) {
				query = new StringBundler(2 +
						(orderByComparator.getOrderByFields().length * 3));

				query.append(_SQL_SELECT_KEYWORD_SMS_RELATION);

				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);

				sql = query.toString();
			}
			else {
				sql = _SQL_SELECT_KEYWORD_SMS_RELATION;
			}

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				if (orderByComparator == null) {
					list = (List<Keyword_Sms_Relation>)QueryUtil.list(q,
							getDialect(), start, end, false);

					Collections.sort(list);
				}
				else {
					list = (List<Keyword_Sms_Relation>)QueryUtil.list(q,
							getDialect(), start, end);
				}
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (list == null) {
					FinderCacheUtil.removeResult(finderPath, finderArgs);
				}
				else {
					cacheResult(list);

					FinderCacheUtil.putResult(finderPath, finderArgs, list);
				}

				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Removes all the keyword_ sms_ relations from the database.
	 *
	 * @throws SystemException if a system exception occurred
	 */
	public void removeAll() throws SystemException {
		for (Keyword_Sms_Relation keyword_Sms_Relation : findAll()) {
			remove(keyword_Sms_Relation);
		}
	}

	/**
	 * Returns the number of keyword_ sms_ relations.
	 *
	 * @return the number of keyword_ sms_ relations
	 * @throws SystemException if a system exception occurred
	 */
	public int countAll() throws SystemException {
		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_KEYWORD_SMS_RELATION);

				count = (Long)q.uniqueResult();
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (count == null) {
					count = Long.valueOf(0);
				}

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
					FINDER_ARGS_EMPTY, count);

				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Initializes the keyword_ sms_ relation persistence.
	 */
	public void afterPropertiesSet() {
		String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
					com.liferay.util.service.ServiceProps.get(
						"value.object.listener.com.caresms.model.Keyword_Sms_Relation")));

		if (listenerClassNames.length > 0) {
			try {
				List<ModelListener<Keyword_Sms_Relation>> listenersList = new ArrayList<ModelListener<Keyword_Sms_Relation>>();

				for (String listenerClassName : listenerClassNames) {
					listenersList.add((ModelListener<Keyword_Sms_Relation>)InstanceFactory.newInstance(
							listenerClassName));
				}

				listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
			}
			catch (Exception e) {
				_log.error(e);
			}
		}
	}

	public void destroy() {
		EntityCacheUtil.removeCache(Keyword_Sms_RelationImpl.class.getName());
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	@BeanReference(type = Category_MasterPersistence.class)
	protected Category_MasterPersistence category_MasterPersistence;
	@BeanReference(type = City_MasterPersistence.class)
	protected City_MasterPersistence city_MasterPersistence;
	@BeanReference(type = Country_MasterPersistence.class)
	protected Country_MasterPersistence country_MasterPersistence;
	@BeanReference(type = Keyword_MasterPersistence.class)
	protected Keyword_MasterPersistence keyword_MasterPersistence;
	@BeanReference(type = Keyword_Sms_RelationPersistence.class)
	protected Keyword_Sms_RelationPersistence keyword_Sms_RelationPersistence;
	@BeanReference(type = Sms_MasterPersistence.class)
	protected Sms_MasterPersistence sms_MasterPersistence;
	@BeanReference(type = ResourcePersistence.class)
	protected ResourcePersistence resourcePersistence;
	@BeanReference(type = UserPersistence.class)
	protected UserPersistence userPersistence;
	private static final String _SQL_SELECT_KEYWORD_SMS_RELATION = "SELECT keyword_Sms_Relation FROM Keyword_Sms_Relation keyword_Sms_Relation";
	private static final String _SQL_COUNT_KEYWORD_SMS_RELATION = "SELECT COUNT(keyword_Sms_Relation) FROM Keyword_Sms_Relation keyword_Sms_Relation";
	private static final String _ORDER_BY_ENTITY_ALIAS = "keyword_Sms_Relation.";
	private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Keyword_Sms_Relation exists with the primary key ";
	private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
				PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
	private static Log _log = LogFactoryUtil.getLog(Keyword_Sms_RelationPersistenceImpl.class);
	private static Keyword_Sms_Relation _nullKeyword_Sms_Relation = new Keyword_Sms_RelationImpl() {
			@Override
			public Object clone() {
				return this;
			}

			@Override
			public CacheModel<Keyword_Sms_Relation> toCacheModel() {
				return _nullKeyword_Sms_RelationCacheModel;
			}
		};

	private static CacheModel<Keyword_Sms_Relation> _nullKeyword_Sms_RelationCacheModel =
		new CacheModel<Keyword_Sms_Relation>() {
			public Keyword_Sms_Relation toEntityModel() {
				return _nullKeyword_Sms_Relation;
			}
		};
}